package com.ssm.controller;

import com.ssm.pojo.TbUser;
import com.ssm.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author 咕唧
 * @Date 2022/5/23 17:56
 * @Version 1.0
 */
@RequestMapping("/user")
@Controller
public class UserController {
    private UserService userService;

    @Autowired
    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    @RequestMapping("/find")
    @ResponseBody
    public TbUser findById(Long id) {
        System.out.println("UserController的findById方法执行了");
        return userService.findById(id);
    }
}
